package toanstt.shop;

import android.graphics.Canvas;
import android.view.MotionEvent;
import toanstt.com.App;
import toanstt.com.Button;
import toanstt.com.SCR;
import toanstt.com.T;

public class Shoppannel 
{
	int minx,miny,maxx,maxy;
	Button but_menu;
	int temp_x,temp_y;
	int action,actionCode ;
	public Shoppannel()
	{
		minx = T.PANEL_MIN_X;
		miny = T.PANEL_MIN_Y;
		maxx = T.PANEL_MAX_X;
		maxy = T.PANEL_MAX_Y;
		but_menu = new Button(T.bitmap_button_menu, (int)(minx + 6.5*T.UNIT), (int)(miny + 18.5*T.UNIT), 4*T.UNIT/80);
	}
	public void Draw(Canvas canvas)
	{
		T.bitmapFont[1].drawString(canvas,"GOLD : " +T.PLAY_GOLD,minx+(int)T.UNIT, (int)(miny+2*T.UNIT), 0);
		T.bitmapFont[0].drawString(canvas,"Stage : " +T.PLAY_CURRENTSTAGE,minx+(int)T.UNIT, (int)(miny+4*T.UNIT), 0);
		T.bitmapFont[0].drawString(canvas,"Record : " +T.PLAY_BEST_CROCE,minx+(int)T.UNIT, (int)(miny+6*T.UNIT), 0);
		but_menu.Draw(canvas);
	}
	public void touch(MotionEvent mo)
	{
		//Log.d("here", "ddddddd");
		action = mo.getAction();
		actionCode = action & MotionEvent.ACTION_MASK;
		temp_x = (int)mo.getX();
		temp_y = (int)mo.getY();
	 if(but_menu.Kick(mo) == true)
		{
			App.mainframe.ResetAllMouseAlpha();
			T.SCREEN = SCR.MENU;
			Shop.ResetAllMouseAlpha();
			return;
		}	
		
		if(actionCode == MotionEvent.ACTION_UP)
		{
			
			but_menu.anpla = 255;
		}
	}
}
